<?php
namespace Admin\Controller;
use Admin\Controller\BaseController;
class DingdanController extends BaseController {
	private $tbl;
	public function _initialize(){
		$this->tbl='dingdan';
		$this->model=D($this->tbl);
		parent::_initialize();
	}
    public function index(){
		parent::index($this->tbl);
    }
	 public function paied(){//已付款
		parent::index($this->tbl,"flag",1);
    }
	 public function unpaied(){//未付款
		parent::index($this->tbl,"flag",0);
    }
	public function	view(){
		$id=I('get.id');//获取id
	}
	public function mod(){//修改界面
		 parent::mod($this->tbl,"id");
	}
	public function update(){//修改
		parent::update($this->tbl,"pic");
	}
	public function delete(){//删除
		parent::delete($this->tbl,"id","pic");
	}
	public function form(){//添加界面
		parent::form($this->tbl);
	}
	public function add(){//添加
		parent::add($this->tbl,"pic");
	}
	public function show(){//显示
		$dnum=I('get.dnum');
		//var_dump($did);
		$sql="select * from dingdandet where dnum='{$dnum}'";
		$res=M()->query($sql);
		$this->assign("list",$res);
		$this->display();
	}
	public function search(){
		parent::search($this->tbl,"dnum","dnum");
	}
}